﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- The styles -->
    <link id="bs-css" href="Theme/Css/bootstrap-cerulean.css" rel="stylesheet" />
    <style type="text/css">
        .sidebar-nav {
            padding: 9px 0;
        }
    </style>
    <link href="Theme/Css/bootstrap-responsive.css" rel="stylesheet" />
    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
	  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
    <!--JS-->
    <!--<script type="text/javascript" src="Scripts/jquery-2.0.3.min.js"></script>-->
    <script type="text/javascript" src="Scripts/jquery-1.7.2.min.js"></script>
    <!-- library for cookie management -->
    <script type="text/javascript" src="Scripts/jquery.cookie.js"></script>
    <!-- history.js for cross-browser state change on ajax -->
    <script type="text/javascript" src="Scripts/jquery.history.js"></script>
    <!-- application script for Charisma demo -->
    <script type="text/javascript" src="Scripts/charisma.js"></script>
    <script src="Scripts/share.data("js" type="text/javascript"></script>
    <script type="text/javascript">
        var isFirstEnter = 1;//是否首次进入页面
        var flag = share.data("Flag");
        $(document).ready(function () {
            var menuId = 5//share.data("SelectedMenu");           
            var menuData;
            var type;
            if (menuId == 2 || menuId == 6 || menuId == 7) {
                menuData = '[{"Name":"公司简介","URL":"About/About.html"},{"Name":"企业愿景","URL":""},{"Name":"发展目标","URL":""},{"Name":"企业荣誉","URL":""},{"Name":"业务范围","URL":""},{"Name":"客户留言","URL":"Contact.html"},{"Name":"联系我们","URL":""}]';
                generateFixedMenu(eval(menuData));
                //self.parent.frames["rightContent"].src = 'About/About.html';
                return;
            }
            else if (menuId == 1) {
                type = 1;
            }
            else if (menuId == 3) {
                type = 3;
            }
            else if (menuId == 4) {
                type = 2;
            }
            else if (menuId == 5) {
                type = 4;
            }
            //getArticles(type);
            //
        })
        function getArticles(category) {
            $.ajax({
                //方法所在页面和方法名   
                url: "BlueHomeHandler.ashx?method=Getcategorytype&Type=" + category,
                contentType: "application/json",
                dataType: "json",
                success: function (data) {
                    //返回的数据用data.d获取内容                  
                    //total_q=data.d;
                    generateMenu(data.ResponseData);
                    InitMenu();
                    return true;
                },
                error: function (err) {
                    alert(err);
                    return false;
                }
            });

            var i = 1 + 1;
        }
        //动态左侧菜单加载
        function generateMenu(data) {
            $("ul.main-menu").empty();
            for (var i = 0 ; i < data.length; i++) {
                //内层循环追加li          
                //$("#lmenu").append('<li class="on"><a href="' + data[i].URL + '" target="rightContent">' + data[i].Name + '</a></li>');
                $("ul.main-menu").append("<li>" +
                    "<a class='ajax-link' onclick='toURL(" + data[i].ID + ")' target='rightContent'>" +
                    "<i class='icon-edit'></i>" +
                    "<span class='hidden-tablet'>" + data[i].TypeName +
                    "</span></a></li>");
            }
            //share.data("SelectedCategoryId", null);
            //if (flag == 1) {
            //    self.parent.frames["rightContent"].location.href = "ShowPage.html";
            //}
            //else {
            //    self.parent.frames["rightContent"].location.href = "RightMenu.html";
            //}
        }
        //固定左侧菜单加载
        function generateFixedMenu(data) {
            $("#lmenu").empty();
            for (var i = 0 ; i < data.length; i++) {
                //内层循环追加li          
                $("ul.main-menu").append('<li class="on"><a href="' + data[i].URL + '" target="rightContent">' + data[i].Name + '</a></li>');
            }
            $("ul.main-menu li a")[5].click();
        }
        function toURL(cId) {
            share.data("SelectedCategoryId", cId);
            //share.data("SelectedPosition", position);
            self.parent.frames["rightContent"].location.href = "RightMenu.html";
        }
    </script>
</head>
<body>

    <!--    <div class="span2 main-menu-span">
        <div class="well nav-collapse sidebar-nav">
            <ul class="nav nav-tabs nav-stacked main-menu">
                <li><a class="ajax-link" href="index.html"><i class="icon-home"></i><span class="hidden-tablet">Dashboard</span></a></li>
                <li><a class="ajax-link" href="ui.html"><i class="icon-eye-open"></i><span class="hidden-tablet">UI Features</span></a></li>
                <li><a class="ajax-link" href="form.html"><i class="icon-edit"></i><span class="hidden-tablet">Forms</span></a></li>
            </ul>
        </div>
    </div>-->

    <div class="span2 main-menu-span">
        <div class="well nav-collapse sidebar-nav">
            <ul class="nav nav-tabs nav-stacked main-menu">
                <li style="margin-left: 5px;"><a class="ajax-link" onclick="toURL(4)" target="rightContent"><i class="icon-edit"></i><span class="hidden-tablet">fyghsdgh</span></a></li>
                <li><a class="ajax-link" onclick="toURL(5)" target="rightContent"><i class="icon-edit"></i><span class="hidden-tablet">dfhdfg</span></a></li>
                <li><a class="ajax-link" onclick="toURL(6)" target="rightContent"><i class="icon-edit"></i><span class="hidden-tablet">sgsdg</span></a></li>
            </ul>
        </div>
    </div>
    <script>
        InitMenu();
    </script>
</body>
</html>
